<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMicroAppsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('micro_apps', function (Blueprint $table) {
            $table->increments('id');
            $table->string('admin_user_id')->default('')->comment('管理员');
            $table->string('name')->default('')->comment('微应用名称');
            $table->text('description')->comment('微应用描述');
            $table->text('whitelist')->comment('服务器IP白名单');
            $table->string('sys_account_id')->default('')->comment('应用账号');
            $table->string('appid')->default('')->comment('App Id');
            $table->string('appsecret')->default('')->comment('App Secret');
            $table->string('access_token')->default('')->nullable(true)->comment('Access Token');
            $table->dateTime('expire_time')->nullable(true)->comment('过期时间');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('micro_apps');
    }
}
